package framework.formfields;

import java.lang.reflect.Field;
import java.text.SimpleDateFormat;

import framework.FormField;

public class FormCheckboxField extends FormField {

	public FormCheckboxField(Field field, String label) throws SecurityException,
	NoSuchFieldException {
		super(field, label);
	}

	public String gerarLinha(Object objeto) throws Exception, Throwable {
		String linhaGerada = "<tr> <td>" + getLabel() + "</td>" + "<td><INPUT TYPE=\"CHECKBOX\" value=\"true\" name=\"" + 
			getField().getName() + "\"";
		if(getField().get(objeto).equals(true)){
			linhaGerada += " checked=\"checked\"";
		}
		linhaGerada += ">Verdade</td></tr>\n";
		return linhaGerada;
	}
}
